package main

import (
	"errors"
	"fmt"
)

/*
* Author: JacksonCoder
* CreateTime: 2025-10-29
 */

func divide(a, b float64) (float64, error) {

	if b == 0 {
		return 0, errors.New("被除数不能为0")
	}

	return a / b, nil

}

func main() {
	result, err := divide(10, 0)
	if err != nil {
		fmt.Println("错误:", err)
		return
	}
	fmt.Println("结果: ", result)
}
